package com.frame.pageform.tag;

abstract public class BaseHandlerTag extends BaseTag{

	protected String id;
	protected String tabindex;
	private String onclick;
	private String ondblclick;
	private String onmouseover;
	private String onmouseout;
	private String onmousemove;
	private String onmousedown;
	private String onmouseup;
	private String onkeydown;
	private String onkeyup;
	private String onkeypress;
	private String onselect;
	private String onchange;
	private String onblur;
	private String onfocus;
	private boolean disabled;
	private String style;
	private String styleClass;
	protected String title;
	private String alt;
	private boolean notNull;
	private String dataName;

	protected void prepareClick(StringBuffer handlers){
		if(onclick != null)
		{
			handlers.append(" onclick=\"");
			handlers.append(getOnclick());
			handlers.append("\"");
		}
	}
	protected void prepareHandler(StringBuffer handlers){
		if(id != null)
		{
			handlers.append(" id=\"");
			handlers.append(getId());
			handlers.append("\"");
		}
		if(style != null)
		{
			handlers.append(" style=\"");
			handlers.append(getStyle());
			handlers.append("\"");
		}
		if(styleClass != null)
		{
			handlers.append(" class=\"");
			handlers.append(getStyleClass());
			handlers.append("\"");
		}
		if(alt != null)
		{
			handlers.append(" alt=\"");
			handlers.append(getAlt());
			handlers.append("\"");
		}
		if(title != null)
		{
			handlers.append(" title=\"");
			handlers.append(title);
			handlers.append("\"");
		}

		if(ondblclick != null)
		{
			handlers.append(" ondblclick=\"");
			handlers.append(getOndblclick());
			handlers.append("\"");
		}
		if(onmouseover != null)
		{
			handlers.append(" onmouseover=\"");
			handlers.append(getOnmouseover());
			handlers.append("\"");
		}
		if(onmouseout != null)
		{
			handlers.append(" onmouseout=\"");
			handlers.append(getOnmouseout());
			handlers.append("\"");
		}
		if(onmousemove != null)
		{
			handlers.append(" onmousemove=\"");
			handlers.append(getOnmousemove());
			handlers.append("\"");
		}
		if(onmousedown != null)
		{
			handlers.append(" onmousedown=\"");
			handlers.append(getOnmousedown());
			handlers.append("\"");
		}
		if(onmouseup != null)
		{
			handlers.append(" onmouseup=\"");
			handlers.append(getOnmouseup());
			handlers.append("\"");
		}
		if(onkeydown != null)
		{
			handlers.append(" onkeydown=\"");
			handlers.append(getOnkeydown());
			handlers.append("\"");
		}
		if(onkeyup != null)
		{
			handlers.append(" onkeyup=\"");
			handlers.append(getOnkeyup());
			handlers.append("\"");
		}
		if(onkeypress != null)
		{
			handlers.append(" onkeypress=\"");
			handlers.append(getOnkeypress());
			handlers.append("\"");
		}
		if(onselect != null)
		{
			handlers.append(" onselect=\"");
			handlers.append(getOnselect());
			handlers.append("\"");
		}
		if(onchange != null)
		{
			handlers.append(" onchange=\"");
			handlers.append(getOnchange());
			handlers.append("\"");
		}
		if(onblur != null)
		{
			handlers.append(" onblur=\"");
			handlers.append(getOnblur());
			handlers.append("\"");
		}
		if(onfocus != null)
		{
			handlers.append(" onfocus=\"");
			handlers.append(getOnfocus());
			handlers.append("\"");
		}
		if(disabled)
			handlers.append(" disabled=\"disabled\"");

	}
	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public String getOnblur() {
		return onblur;
	}

	public void setOnblur(String onblur) {
		this.onblur = onblur;
	}

	public String getOnchange() {
		return onchange;
	}

	public void setOnchange(String onchange) {
		this.onchange = onchange;
	}

	public String getOnclick() {
		return onclick;
	}

	public void setOnclick(String onclick) {
		this.onclick = onclick;
	}

	public String getOndblclick() {
		return ondblclick;
	}

	public void setOndblclick(String ondblclick) {
		this.ondblclick = ondblclick;
	}

	public String getOnfocus() {
		return onfocus;
	}

	public void setOnfocus(String onfocus) {
		this.onfocus = onfocus;
	}

	public String getOnkeydown() {
		return onkeydown;
	}

	public void setOnkeydown(String onkeydown) {
		this.onkeydown = onkeydown;
	}

	public String getOnkeypress() {
		return onkeypress;
	}

	public void setOnkeypress(String onkeypress) {
		this.onkeypress = onkeypress;
	}

	public String getOnkeyup() {
		return onkeyup;
	}

	public void setOnkeyup(String onkeyup) {
		this.onkeyup = onkeyup;
	}

	public String getOnmousedown() {
		return onmousedown;
	}

	public void setOnmousedown(String onmousedown) {
		this.onmousedown = onmousedown;
	}

	public String getOnmousemove() {
		return onmousemove;
	}

	public void setOnmousemove(String onmousemove) {
		this.onmousemove = onmousemove;
	}

	public String getOnmouseout() {
		return onmouseout;
	}

	public void setOnmouseout(String onmouseout) {
		this.onmouseout = onmouseout;
	}

	public String getOnmouseover() {
		return onmouseover;
	}

	public void setOnmouseover(String onmouseover) {
		this.onmouseover = onmouseover;
	}

	public String getOnmouseup() {
		return onmouseup;
	}

	public void setOnmouseup(String onmouseup) {
		this.onmouseup = onmouseup;
	}

	public String getOnselect() {
		return onselect;
	}

	public void setOnselect(String onselect) {
		this.onselect = onselect;
	}

	public String getStyleClass() {
		return styleClass;
	}

	public void setStyleClass(String styleClass) {
		this.styleClass = styleClass;
	}

	public String getTabindex() {
		return tabindex;
	}

	public void setTabindex(String tabindex) {
		this.tabindex = tabindex;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	public String getStyle() {
		return style;
	}
	public void setStyle(String style) {
		this.style = style;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getAlt() {
		return alt;
	}
	public void setAlt(String alt) {
		this.alt = alt;
	}
	public boolean isNotNull() {
		return notNull;
	}
	public void setNotNull(boolean notNull) {
		this.notNull = notNull;
	}
	public String getDataName() {
		return dataName;
	}
	public void setDataName(String dataName) {
		this.dataName = dataName;
	}

}
